extends Area2D
 
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
	#for i in get_overlapping_areas():
		#if i.is_in_group("ball"):
			#i.rate.x = 200
			#i.pong()
	var player1up = Input.get_action_strength("ui_right")
	var player1down = Input.get_action_strength("ui_left")
	var pos = self.position.y - 200*player1up*delta + player1down*200*delta
	if  pos > 16 &&  pos < 630:
		self.position.y = pos

func _on_area_entered(area):
	if area.is_in_group("ball"):
		area.reverseX()
		area.pong()
